โ– humdrum codex / glint v1.0.2
license AGPL-3.0
1.6 KB raw
id
TASK-029
title
Mouse-wheel scroll sequences leak into buffer as text
status
๐Ÿ Done
assignee
created_date
2026-06-30 04:05
updated_date
2026-06-30 04:08
labels
bug
dependencies
priority
high
ordinal
29000

Description

Fast wheel-scrolling (esp. near the top of a doc, Ghostty) inserts literal SGR mouse escape residue into the buffer, e.g. '<64;68;26M<64;68;26M...'. Cause: Bubble Tea's input parser splits a burst of SGR mouse sequences across read boundaries and emits the leftover as a KeyRunes text event, which the editor inserts. Mouse is enabled (WithMouseCellMotion) and wheel events ARE handled; this is parser leakage, not missing handling. bubbletea v1.3.10 is already latest. Fix: drop KeyRunes events that are entirely a leaked mouse sequence at the input boundary.

Acceptance Criteria

Implementation Notes

Added looksLikeMouseLeak (mouseleak.go): regexp ^(<?\d+;\d+;\d+[Mm])+$ matches a KeyRunes that is entirely SGR mouse residue; guarded at top of app.handleKey to drop it. Defense against Bubble Tea v1.3.10 input parser splitting a burst of wheel-scroll SGR sequences and emitting the tail as text. Normal input (lone '<', text with '<'/';', comparisons) unaffected. TDD, all tests pass.